# eric7.WebBrowser.GreaseMonkey.GreaseMonkeyManager

Module implementing the manager for GreaseMonkey scripts.

### Global Attributes

None

### Classes

GreaseMonkeyManager | Class implementing the manager for GreaseMonkey scripts.

### Functions

None

## GreaseMonkeyManager

Class implementing the manager for GreaseMonkey scripts.

### Signals

scriptsChanged()
  emitted to indicate a change of scripts

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

GreaseMonkeyManager | Constructor
__downloaderFinished | Private slot to handle the completion of a script download.
__load | Private slot to load the available scripts into the manager.
__scriptChanged | Private slot handling a changed script.
addScript | Public method to add a script.
allScripts | Public method to get a list of all scripts.
canRunOnScheme | Public method to check, if scripts can be run on a scheme.
containsScript | Public method to check, if the given script exists.
disableScript | Public method to disable the given script.
doDownloadScript | Public slot to download a GreaseMonkey script.
downloadScript | Public method to download a GreaseMonkey script.
enableScript | Public method to enable the given script.
removeScript | Public method to remove a script.
requireScripts | Public method to get the sources of all required scripts.
requireScriptsDirectory | Public method to get the path of the scripts directory.
saveConfiguration | Public method to save the configuration.
scriptsDirectory | Public method to get the path of the scripts directory.
showConfigurationDialog | Public method to show the configuration dialog.

### Static Methods

None

#### GreaseMonkeyManager (Constructor)

GreaseMonkeyManager(parent=None)

Constructor

parent (QObject)
  reference to the parent object

#### GreaseMonkeyManager.__downloaderFinished

__downloaderFinished(fileName, downloader)

Private slot to handle the completion of a script download.

fileName (str)
  name of the downloaded script
downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyManager.__load

__load()

Private slot to load the available scripts into the manager.

#### GreaseMonkeyManager.__scriptChanged

__scriptChanged(script)

Private slot handling a changed script.

script (GreaseMonkeyScript)
  reference to the changed script

#### GreaseMonkeyManager.addScript

addScript(script)

Public method to add a script.

script (GreaseMonkeyScript)
  script to be added

Return:
  flag indicating success

Return Type:
  bool

#### GreaseMonkeyManager.allScripts

allScripts()

Public method to get a list of all scripts.

Return:
  list of all scripts (list o

Return Type:
  GreaseMonkeyScript

#### GreaseMonkeyManager.canRunOnScheme

canRunOnScheme(scheme)

Public method to check, if scripts can be run on a scheme.

scheme (str)
  scheme to check

Return:
  flag indicating, that scripts can be run

Return Type:
  bool

#### GreaseMonkeyManager.containsScript

containsScript(fullName)

Public method to check, if the given script exists.

fullName (str)
  full name of the script

Return:
  flag indicating the existence

Return Type:
  bool

#### GreaseMonkeyManager.disableScript

disableScript(script)

Public method to disable the given script.

script (GreaseMonkeyScript)
  script to be disabled

#### GreaseMonkeyManager.doDownloadScript

doDownloadScript(url)

Public slot to download a GreaseMonkey script.

Note: The download needed to be separated in the invoking part (s.a.) and the one doing the real download because the invoking part runs in a different thread (i.e. the web engine thread).

url (QUrl)
  URL to download script from

#### GreaseMonkeyManager.downloadScript

downloadScript(url)

Public method to download a GreaseMonkey script.

url (QUrl)
  URL to download script from

#### GreaseMonkeyManager.enableScript

enableScript(script)

Public method to enable the given script.

script (GreaseMonkeyScript)
  script to be enabled

#### GreaseMonkeyManager.removeScript

removeScript(script, removeFile=True)

Public method to remove a script.

script (GreaseMonkeyScript)
  script to be removed
removeFile (bool)
  flag indicating to remove the script file as well

Return:
  flag indicating success

Return Type:
  bool

#### GreaseMonkeyManager.requireScripts

requireScripts(urlList)

Public method to get the sources of all required scripts.

urlList (list of str)
  list of URLs

Return:
  sources of all required scripts

Return Type:
  str

#### GreaseMonkeyManager.requireScriptsDirectory

requireScriptsDirectory()

Public method to get the path of the scripts directory.

Return:
  path of the scripts directory

Return Type:
  str

#### GreaseMonkeyManager.saveConfiguration

saveConfiguration()

Public method to save the configuration.

#### GreaseMonkeyManager.scriptsDirectory

scriptsDirectory()

Public method to get the path of the scripts directory.

Return:
  path of the scripts directory

Return Type:
  str

#### GreaseMonkeyManager.showConfigurationDialog

showConfigurationDialog(parent=None)

Public method to show the configuration dialog.

parent (QWidget)
  reference to the parent widget

Up